Merged
Conversation
…ted build configurations
…the right sqlite-wasm tag
…of double quotes in query strings for wasm support
marcobambini
requested changes
Jul 4, 2025
Member
marcobambini
left a comment
There was a problem hiding this comment.
Summary of the requested changes:
- Double quotes must be used for identifiers.
- WASM specific network code must be in a separate network_wasm.c file (like network.m for objc specific code)
| // MARK: - Utils - | ||
|
|
||
| #ifndef CLOUDSYNC_OMIT_CURL | ||
| #ifdef SQLITE_WASM_EXTRA_INIT |
Member
There was a problem hiding this comment.
I would prefer to have the wasm-related network code in a separate file. We have network.m for objc; we could have network_wasm.c, with the three network functions.
| @@ -137,18 +137,18 @@ char *build_changes_sql (sqlite3 *db, const char *idxs) { | |||
| "changes_query AS ( " | |||
Member
There was a problem hiding this comment.
col_name and table_name are identifiers so they must be quoted in double quotes
| // the good news is that the query can be computed in SQLite without the need to do any extra computation from the host language | ||
| const char *sql = "WITH table_names AS (" | ||
| "SELECT format(\"%w\", name) as tbl_name " | ||
| "SELECT format('%w', name) as tbl_name " |
Member
There was a problem hiding this comment.
This is wrong, identifiers like table names must be quoted in double quotes.
| // according to the following rules in the order shown: | ||
| // 1. If the declared type contains the string "INT" then it is assigned INTEGER affinity. | ||
| sql = sqlite3_snprintf((int)blen, buffer, "SELECT count(*) FROM pragma_table_info('%w') WHERE pk=1 AND \"type\" LIKE \"%%INT%%\";", name); | ||
| sql = sqlite3_snprintf((int)blen, buffer, "SELECT count(*) FROM pragma_table_info('%w') WHERE pk=1 AND \"type\" LIKE '%%INT%%';", name); |
Member
There was a problem hiding this comment.
This is right because %%INT%% is a literal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.